<?php
use App\Http\Tools as Tools;

?>
<!--    继承layouts/thr_master.php模板  -->
@extends('layouts.thr_master')


<!-- 重写内容  -->
@section('content')

<h1 align="center">项目列表</h1>

<div align="center">
	<table border="1">
		<tr>
			<th>序号</th>
			<th>项目</th>	
			<th>项目状况</th>
			<th>操作</th>

			<th>开题报告</th>
			<th>中期检查表</th>
			<th>结题报告</th>
			<th>成果跟踪</th>
			<th>展板提交</th>
			<th>经费预算</th>

			<th>修改</th>
			<th>删除</th>
		</tr>
		@if(!empty($user))
			@for($i=0;$i< count($user->projects);$i++)
				<tr>
					<td>{{$i+1}}</td>
					<td>
						<a href="/thr_pro_detail/{{$user->projects[$i]->pid}}">{{$user->projects[$i]->pname }}</a>
					</td>
					
					



					@if($user->projects[$i]->type==0)
						<td>
							{{Tools::getState(0)}}
						</td>
						<td>
							<a href="#" >
								<button type="submit" disabled name="link">无操作</button>
							</a>
						</td>
					@elseif($user->projects[$i]->type==1)
						<td>
							{{Tools::getState(1)}}
						</td>
						<td>
							<a href="/thr/confirm/{{$user->projects[$i]->pid}}">
								<button type="submit" name="link">选择组员</button>
							</a>
						</td>
					@elseif($user->projects[$i]->type==2)
						<td>
							{{Tools::getState(2)}}
						</td>
						<td>
							<a href="#">
								<button type="submit" disabled name="link">无操作</button>
							</a>
						</td>
					@elseif($user->projects[$i]->type==3)
						<td>
							{{Tools::getState(3)}}
						</td>
						<td>
							<a href="/thr/confirm_start/{{$user->projects[$i]->pid}}">
								<button type="submit" name="link">开题审核</button>
							</a>
						</td>
					@elseif($user->projects[$i]->type==4)
					<td>
						{{Tools::getState(4)}}
					</td>
					<td>
						<a href="#">
							<button type="submit" disabled name="link">无操作</button>
						</a>
					</td>
					@elseif($user->projects[$i]->type==5)
					<td>
						{{Tools::getState(5)}}
					</td>
					<td>
						<a href="/thr/confirm_mid/{{$user->projects[$i]->pid}}">
							<button type="submit" name="link">中期审核</button>
						</a>
					</td>
					@elseif($user->projects[$i]->type==6)
					<td>
						{{Tools::getState(6)}}
					</td>
					<td>
						<a href="#">
							<button type="submit" disabled name="link">无操作</button>
						</a>
					</td>
					@elseif($user->projects[$i]->type==7)
					<td>
						{{Tools::getState(7)}}
					</td>
					<td>
						<a href="/thr/confirm_end/{{$user->projects[$i]->pid}}">
							<button type="submit" name="link">结题审核</button>
						</a>
					</td>
					@elseif($user->projects[$i]->type==8)
					<td>
						{{Tools::getState(8)}}
					</td>
					<td>
						<a href="#">
							<button type="submit" disabled name="link">无操作</button>
						</a>
					</td>
					@elseif($user->projects[$i]->type==9)
					<td>
						{{Tools::getState(9)}}
					</td>
					<td>
						<a href="/thr/confirm_result/{{$user->projects[$i]->pid}}">
							<button type="submit" name="link">成果审核</button>
						</a>
					</td>
					@elseif($user->projects[$i]->type==10)
					<td>
						{{Tools::getState(10)}}
					</td>
					<td>
						<a href="#">
							<button type="submit" disabled name="link">无操作</button>
						</a>
					</td>
					@elseif($user->projects[$i]->type==11)
					<td>
						{{Tools::getState(11)}}
					</td>
					<td>
						<a href="/thr/confirm_panels/{{$user->projects[$i]->pid}}">
							<button type="submit" name="link">展板审核</button>
						</a>
					</td>
					@elseif($user->projects[$i]->type==12)
					<td>
						{{Tools::getState(12)}}
					</td>
					<td>
						<a href="/thr/confirm_panels/{{$user->projects[$i]->pid}}">
							<button type="submit" disabled name="link">无操作</button>
						</a>
					</td>
					@endif


					@if($user->projects[$i]->type>3)
					<td><a href="/thr/confirm_start/{{$user->projects[$i]->pid}}">查看</a></td>
					@else
					<td>无</td>
					@endif

					@if($user->projects[$i]->type>5)
					<td><a href="/thr/confirm_mid/{{$user->projects[$i]->pid}}">查看</a></td>
					@else
					<td>无</td>
					@endif
					
					@if($user->projects[$i]->type>7)
					<td><a href="/thr/confirm_end/{{$user->projects[$i]->pid}}">查看</a></td>
					@else
					<td>无</td>
					@endif
					
					@if($user->projects[$i]->type>9)
					<td><a href="/thr/confirm_result/{{$user->projects[$i]->pid}}">查看</a></td>
					@else
					<td>无</td>
					@endif
					
					@if($user->projects[$i]->type>11)
					<td><a href="/thr/confirm_panels/{{$user->projects[$i]->pid}}">查看</a></td>
					@else
					<td>无</td>
					@endif

					@if($user->projects[$i]->type < 12)
					<td>
						<a href="/thr/modify_fees/{{$user->projects[$i]->pid}}">
							<button type="submit"  name="link">修改经费</button>
						</a>
					</td>
					@else
					<td>
						<a href="/thr/modify_fees/{{$user->projects[$i]->pid}}">
							<button type="submit"  name="link">修改经费</button>
						</a>
					</td>
					@endif





					@if($user->projects[$i]->type <=1 )
					<td>
						<a href="/thr/modify_pro/{{$user->projects[$i]->pid}}">
							<button type="submit"  name="link">修改</button>
						</a>
					</td>

					@else

					<td>
						<a href="#">
							<button type="submit" disabled name="link">修改</button>
						</a>
					</td>
					@endif



					@if($user->projects[$i]->type ==0 )
					<td>
						<a href="/thr/delete_pro/{{$user->projects[$i]->pid}}">
							<button type="submit"  name="link">删除</button>
						</a>
					</td>
					@else
					<td>
						<a href="#">
							<button type="submit" disabled name="link">删除</button>
						</a>
					</td>
					@endif




				</tr>

			@endfor
		@else
			<h3 align="center">你还没有发布任何项目</h3>
		@endif
	</table>
</div>
@endsection




